package com.ruoyi.config.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.config.mapper.AliyunOssConfigMapper;
import com.ruoyi.config.domain.AliyunOssConfig;
import com.ruoyi.config.service.IAliyunOssConfigService;

/**
 * 阿里云oss配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-16
 */
@Service
public class AliyunOssConfigServiceImpl implements IAliyunOssConfigService 
{
    @Autowired
    private AliyunOssConfigMapper aliyunOssConfigMapper;

    /**
     * 查询阿里云oss配置
     * 
     * @param id 阿里云oss配置主键
     * @return 阿里云oss配置
     */
    @Override
    public AliyunOssConfig selectAliyunOssConfigById(Long id)
    {
        return aliyunOssConfigMapper.selectAliyunOssConfigById(id);
    }

    /**
     * 查询阿里云oss配置列表
     * 
     * @param aliyunOssConfig 阿里云oss配置
     * @return 阿里云oss配置
     */
    @Override
    public List<AliyunOssConfig> selectAliyunOssConfigList(AliyunOssConfig aliyunOssConfig)
    {
        return aliyunOssConfigMapper.selectAliyunOssConfigList(aliyunOssConfig);
    }

    /**
     * 新增阿里云oss配置
     * 
     * @param aliyunOssConfig 阿里云oss配置
     * @return 结果
     */
    @Override
    public int insertAliyunOssConfig(AliyunOssConfig aliyunOssConfig)
    {
        aliyunOssConfig.setCreateTime(DateUtils.getNowDate());
        return aliyunOssConfigMapper.insertAliyunOssConfig(aliyunOssConfig);
    }

    /**
     * 修改阿里云oss配置
     * 
     * @param aliyunOssConfig 阿里云oss配置
     * @return 结果
     */
    @Override
    public int updateAliyunOssConfig(AliyunOssConfig aliyunOssConfig)
    {
        aliyunOssConfig.setUpdateTime(DateUtils.getNowDate());
        return aliyunOssConfigMapper.updateAliyunOssConfig(aliyunOssConfig);
    }

    /**
     * 批量删除阿里云oss配置
     * 
     * @param ids 需要删除的阿里云oss配置主键
     * @return 结果
     */
    @Override
    public int deleteAliyunOssConfigByIds(Long[] ids)
    {
        return aliyunOssConfigMapper.deleteAliyunOssConfigByIds(ids);
    }

    /**
     * 删除阿里云oss配置信息
     * 
     * @param id 阿里云oss配置主键
     * @return 结果
     */
    @Override
    public int deleteAliyunOssConfigById(Long id)
    {
        return aliyunOssConfigMapper.deleteAliyunOssConfigById(id);
    }
}
